home *** CD-ROM | disk | FTP | other *** search
/ MacAddict: Utilities / MacAddict S Utilities.iso / Utilities / Creative Tools / TypeIndexer2.0.4 / TypeIndexer2.0.4dl / TypeIndexer2.0.4dl.rsrc / FNSP_100_Adobe’s FontSample.PS < prev    next >
Text File  |  1996-08-28  |  8KB  |  277 lines

  1.  
  2. %!
  3. %!
  4. %The digitally encoded machine readable software for producing the
  5. %Typefaces licensed to you is copyrighted (c) 1984-90 Adobe Systems,
  6. %(c) 1981 Linotype.  All rights reserved. This software is protected as a
  7. %trade secret and is the property of Adobe Systems Incorporated and its
  8. %licensors, and may not be reproduced, used, displayed, modified,
  9. %disclosed or transferred without the express written approval of Adobe.
  10. % sort.ps
  11.  
  12. /$sort 20 dict def
  13.  
  14. /SortInit                       % return root of empty binary tree
  15.    {1 array} def
  16.  
  17. /Insert                         % <root> <string> inserts string in tree
  18.    {exch dup 0 get type /nulltype eq
  19.      {exch [ exch 1 array 1 array ] 0 exch put}
  20.      {aload pop aload pop 4 2 roll 2 copy gt
  21.        {pop 3 -1 roll pop Insert}
  22.        {pop exch pop Insert}
  23.       ifelse
  24.      }ifelse
  25.    }def
  26.  
  27. /PrefixWalk                     % <root><proc> execute proc for each element
  28.    {$sort begin
  29.     cvx /!bt exch def bpwalk
  30.     end
  31.    }def
  32.  
  33. $sort begin
  34.  
  35. /bpwalk
  36.    {dup 0 get type /nulltype eq
  37.       {pop}
  38.       {aload pop aload pop exch bpwalk exch !bt bpwalk}
  39.     ifelse
  40.    }def
  41.  
  42. /bbwalk
  43.    {dup 0 get type /nulltype eq
  44.        {pop}
  45.        {aload pop aload pop bbwalk exch !bt bbwalk}
  46.     ifelse
  47.    }def
  48.  
  49. end % $sort
  50. %!
  51. % showfont.ps: print all characters in a font, encoded first, unencoded
  52. % second. Assumes several other PostScript files included.
  53. /tempstring 128 string def
  54.  
  55. /showfont { % fontname:name
  56.     /fontname exch def
  57.     /left paperwidth width sub 2 div def
  58.     /right left width add def
  59.     /marklength ptsize 20 div def
  60.     /fontdict fontname findfont def
  61.     fontdict dup /CharStrings known
  62.       {/CharStrings get} % for outline fonts
  63.       {/CharData get} % for bitmap fonts
  64.     ifelse /chardict exch def
  65.     fontdict dup /FontInfo known
  66.       {/FontInfo get dup /Notice known % for outline fonts
  67.       {/Notice get}
  68.       {pop ()} ifelse}
  69.       {pop ()} % for bitmap fonts
  70.     ifelse /notice exch def
  71.     fontdict dup /FontInfo known
  72.       {/FontInfo get dup /FullName known % for outline fonts
  73.       {/FullName get}
  74.       { fontname tempstring cvs } ifelse}
  75.       {fontname} % for bitmap fonts
  76.     ifelse /fullname exch def
  77.     fontdict dup /FontInfo known
  78.         fontdict dup /FontInfo known
  79.       {/FontInfo get dup /version known % for outline fonts
  80.       {/version get}
  81.       {pop ()} ifelse}
  82.       {pop ()} % for bitmap fonts
  83.  
  84.     ifelse /fversion exch def
  85.     /nam chardict maxlength dict def
  86.     /enc fontdict /Encoding get def
  87.     writeheader
  88.     fontname findfont ptsize scalefont setfont
  89.     currentfont /FontMatrix get 3 get /scale exch def
  90.     currentfont /FontBBox get aload pop
  91.     /ascent exch scale mul def pop
  92.     /descent exch scale mul def pop
  93.     0 255 showchars
  94.     printunencoded
  95.     /Times-Bold findfont 24 scalefont setfont
  96.     1.5 inch 10 inch moveto
  97.     %(CHARACTER SET SAMPLE PAGE) show
  98.     fullname show
  99.     /Times-Italic findfont 16 scalefont setfont
  100.     1 inch 2 inch moveto
  101.     (The characters shown here represent the complete PostScript) show
  102.     /Symbol findfont 12 scalefont setfont
  103.     (\322) show
  104.     /Times-Italic findfont 16 scalefont setfont
  105.     ( character set.) show
  106.     /Times-BoldItalic findfont 16 scalefont setfont
  107.     1 inch 1.7 inch moveto
  108.     (Not all the characters shown here are accessible on all personal computers.)
  109. show
  110.     /Times-Roman findfont 8 scalefont setfont
  111.     1 inch 1.35 inch moveto
  112.     (PostScript is a registered trademark of Adobe Systems Incorporated.) show
  113.     1 inch 1.20 inch moveto
  114.     shownotice {notice show} if
  115.  
  116.     showpage
  117.   } def
  118.  
  119. /printunencoded {
  120.     % make sorted list (slist) of unencoded characters
  121.     nam /.notdef -1 put
  122.     /slist SortInit def
  123.     chardict {
  124.       pop /cname exch def
  125.       nam cname known not
  126.         { slist cname dup length string cvs Insert }
  127.       if
  128.     } forall
  129.  
  130.     % locate an open spot in the encoding vector
  131.     /counter 0 def /found false def
  132.     enc {
  133.       /.notdef eq
  134.         { /found true def exit }
  135.         { /counter counter 1 add def }
  136.       ifelse
  137.     } forall
  138.     found not {} if
  139. %/encodingvectorfull /printunencoded /.error cvx exec in above line
  140.     % print every character in the sorted list
  141.     slist {
  142.       /cname exch cvn def
  143.       /savemarker save def
  144.       /newfont currentfont maxlength dict def
  145.       currentfont {
  146.         exch dup /FID ne
  147.           { dup /Encoding eq
  148.               {exch dup length array copy newfont 3 1 roll put}
  149.               {exch newfont 3 1 roll put}
  150.             ifelse }
  151.           {pop pop}
  152.         ifelse
  153.       } forall
  154.       newfont /Encoding get counter cname put
  155.       /TempFont newfont definefont setfont
  156.       counter showch
  157.       x yline % leave these on the stack to save them after the 'restore'
  158.       savemarker restore
  159.       /yline exch def /x exch def
  160.       x yline moveto
  161.     } PrefixWalk
  162.   } def
  163.  
  164. % redefinitions
  165. /inch {72 mul} def
  166. /top 9.5 inch def
  167. /bot 1 inch def
  168. /paperwidth 8.5 inch def
  169. /markwidth .25 def
  170. /headerptsize 10 def
  171. /headerfont /Helvetica findfont headerptsize scalefont def
  172. /headerspace 12 def % extra space between header and first line
  173. /bigruleht 15 def
  174. /smallruleht .5 def
  175. /rulespace 4 def
  176. /tempstring 128 string def
  177.  
  178. /rule { % width, height
  179.     /h exch def /w exch def
  180.     0 h rlineto w 0 rlineto 0 0 h sub rlineto closepath fill
  181.   } def
  182.  
  183. /writeheader { % prints page header/footer and resets /yline
  184.     gsave
  185.       headerfont setfont
  186.       left top moveto gsave right left sub bigruleht rule grestore
  187.       bigruleht headerptsize sub dup rmoveto
  188.       gsave
  189.      
  190.         1 setgray
  191.         showfullname {fullname show ( \() show} if
  192.         fontname tempstring cvs show
  193.         showversion {
  194.           ( ) show
  195.           showfullname not {(\() show} if
  196.           fversion show
  197.         } if
  198.         showversion showfullname or {(\)) show} if
  199.       grestore
  200.       left top rulespace sub moveto right left sub smallruleht rule
  201.       showproduct {
  202.         1 inch .75 inch moveto
  203.         (FontSampler (c)1994 Lupin Software    ) show statusdict /product get
  204. show
  205. ( v. ) show version show
  206.       } if
  207.     grestore
  208.     /yline top ptsize headerspace add sub def
  209.     /x left def
  210.     x yline moveto
  211.   } def
  212. /showchars { % initial, final: number
  213.     1 exch
  214.     { /ccode exch def
  215.       /cname enc ccode get def
  216.       cname /.notdef ne chardict cname known and
  217.         { nam cname ccode put ccode showch }
  218.       if
  219.     } for
  220.   } def
  221. /showch { % c:number
  222.     /chs ( ) dup 0 5 -1 roll put def
  223.     /chw chs stringwidth pop def
  224.     x chw add space add right gt { wrap } if
  225.     showsbmarks {false sb} if
  226.     showbbox {sbb} if
  227.     chs show
  228.     showsbmarks {true sb} if
  229.     space 0 rmoveto
  230.     /x x chw add space add def
  231.   } def
  232. /sb { % rightsb:boolean
  233.   /rightsb exch def
  234.   gsave
  235.     currentpoint translate
  236.     0 marklength neg moveto 0 marklength lineto
  237.     0 0 moveto marklength rightsb {neg} if 0 lineto
  238.     markwidth setlinewidth stroke
  239.   grestore
  240.   } def
  241. /sbb {
  242.   gsave
  243.     currentpoint translate
  244.     0 0 moveto 0 ascent rlineto chw 0 rlineto
  245.     0 ascent neg descent add rlineto chw neg 0 rlineto closepath
  246.     markwidth setlinewidth stroke
  247.   grestore
  248.   } def
  249. /pagebreak {showpage writeheader} def
  250. /newline {
  251.     /yline yline ptsize lead add sub def
  252.     /x left def
  253.     yline bot lt {pagebreak} if
  254.   } def
  255. /wrap {
  256.     newline
  257.     /x left def
  258.     x yline moveto
  259.   } def
  260.     /ptsize 24 def
  261.     /lead 4 def
  262.     /space 4 def
  263.     /width 400 def
  264.     /showfullname true def
  265.     /shownotice true def
  266.     /showversion true def
  267.     /showsbmarks false def
  268.     /showbbox false def
  269.     /showproduct true def
  270. %To the user: In the last line of this file,
  271. %type slash followed by the typefaces
  272. %PostScript name, followed by the space,
  273. %and the word showfont,
  274. %e.g., /Bookman-Demi showfont
  275.  
  276. LR_FontName showfont
  277.